STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Member Functions | List of all members
unique_ptr< _Ty[], _Dx > Class Template Reference
Inheritance diagram for unique_ptr< _Ty[], _Dx >:
_Unique_ptr_base< _Ty, _Dx >

Public Types

typedef unique_ptr< _Ty[], _Dx > _Myt
 
typedef _Unique_ptr_base< _Ty, _Dx > _Mybase
 
typedef _Mybase::pointer pointer
 
typedef _Ty element_type
 
typedef _Dx deleter_type
 
template<class _Uty , class _Is_nullptr = is_same<_Uty, nullptr_t>>
using _Enable_ctor_reset = enable_if_t< is_same< _Uty, pointer >::value||_Is_nullptr::value||(is_same< pointer, element_type * >::value &&is_pointer< _Uty >::value &&is_convertible< remove_pointer_t< _Uty >(*)[], element_type(*)[] >::value)>
 
template<class _Uty , class _Ex , bool _More, class _UP_pointer = typename unique_ptr<_Uty, _Ex>::pointer, class _UP_element_type = typename unique_ptr<_Uty, _Ex>::element_type>
using _Enable_conversion = enable_if_t< is_array< _Uty >::value &&is_same< pointer, element_type * >::value &&is_same< _UP_pointer, _UP_element_type * >::value &&is_convertible< _UP_element_type(*)[], element_type(*)[]>::value &&_More >
 
- Public Types inherited from _Unique_ptr_base< _Ty, _Dx >
typedef remove_reference_t< _Dx > _Dx_noref
 
typedef _Get_deleter_pointer_type< _Ty, _Dx_noref >::type pointer
 

Public Member Functions

constexpr unique_ptr () _NOEXCEPT
 
template<class _Uty , class = _Enable_ctor_reset<_Uty>>
 unique_ptr (_Uty _Ptr) _NOEXCEPT
 
template<class _Uty , class = _Enable_ctor_reset<_Uty>>
 unique_ptr (_Uty _Ptr, typename _If< is_reference< _Dx >::value, _Dx, const typename remove_reference< _Dx >::type & >::type _Dt) _NOEXCEPT
 
template<class _Uty , class = _Enable_ctor_reset<_Uty>>
 unique_ptr (_Uty _Ptr, typename remove_reference< _Dx >::type &&_Dt) _NOEXCEPT
 
 unique_ptr (unique_ptr &&_Right) _NOEXCEPT
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT
 
template<class _Uty , class _Ex , class = _Enable_conversion<_Uty, _Ex, is_reference<_Dx>::value ? is_same<_Ex, _Dx>::value : is_convertible<_Ex, _Dx>::value>>
 unique_ptr (unique_ptr< _Uty, _Ex > &&_Right) _NOEXCEPT
 
template<class _Uty , class _Ex , class = _Enable_conversion<_Uty, _Ex, is_assignable<_Dx&, _Ex&&>::value>>
_Mytoperator= (unique_ptr< _Uty, _Ex > &&_Right) _NOEXCEPT
 
constexpr unique_ptr (nullptr_t) _NOEXCEPT
 
_Mytoperator= (nullptr_t) _NOEXCEPT
 
void reset (nullptr_t=nullptr_t{}) _NOEXCEPT
 
void swap (_Myt &_Right) _NOEXCEPT
 
 ~unique_ptr () _NOEXCEPT
 
_Ty & operator[] (size_t _Idx) const
 
pointer get () const _NOEXCEPT
 
 operator bool () const _NOEXCEPT
 
pointer release () _NOEXCEPT
 
template<class _Uty , class = _Enable_ctor_reset<_Uty, false_type>>
void reset (_Uty _Ptr) _NOEXCEPT
 
 unique_ptr (const _Myt &)=delete
 
_Mytoperator= (const _Myt &)=delete
 
- Public Member Functions inherited from _Unique_ptr_base< _Ty, _Dx >
template<class _Ptr2 , class _Dx2 >
 _Unique_ptr_base (_Ptr2 _Ptr, _Dx2 &&_Dt)
 
template<class _Ptr2 >
constexpr _Unique_ptr_base (_Ptr2 _Ptr)
 
_Dx & get_deleter () _NOEXCEPT
 
const _Dx & get_deleter () const _NOEXCEPT
 
pointer_Myptr () _NOEXCEPT
 
const pointer_Myptr () const _NOEXCEPT
 

Private Member Functions

void _Delete ()
 

Additional Inherited Members

- Public Attributes inherited from _Unique_ptr_base< _Ty, _Dx >
_Compressed_pair< _Dx, pointer_Mypair
 

Member Typedef Documentation

template<class _Ty , class _Dx >
template<class _Uty , class _Ex , bool _More, class _UP_pointer = typename unique_ptr<_Uty, _Ex>::pointer, class _UP_element_type = typename unique_ptr<_Uty, _Ex>::element_type>
using unique_ptr< _Ty[], _Dx >::_Enable_conversion = enable_if_t< is_array<_Uty>::value && is_same<pointer, element_type *>::value && is_same<_UP_pointer, _UP_element_type *>::value && is_convertible<_UP_element_type(*)[], element_type(*)[]>::value && _More>
template<class _Ty , class _Dx >
template<class _Uty , class _Is_nullptr = is_same<_Uty, nullptr_t>>
using unique_ptr< _Ty[], _Dx >::_Enable_ctor_reset = enable_if_t< is_same<_Uty, pointer>::value || _Is_nullptr::value || (is_same<pointer, element_type *>::value && is_pointer<_Uty>::value && is_convertible< remove_pointer_t<_Uty>(*)[], element_type(*)[] >::value)>
template<class _Ty , class _Dx >
typedef _Unique_ptr_base<_Ty, _Dx> unique_ptr< _Ty[], _Dx >::_Mybase
template<class _Ty , class _Dx >
typedef unique_ptr<_Ty[], _Dx> unique_ptr< _Ty[], _Dx >::_Myt
template<class _Ty , class _Dx >
typedef _Dx unique_ptr< _Ty[], _Dx >::deleter_type
template<class _Ty , class _Dx >
typedef _Ty unique_ptr< _Ty[], _Dx >::element_type
template<class _Ty , class _Dx >
typedef _Mybase::pointer unique_ptr< _Ty[], _Dx >::pointer

Constructor & Destructor Documentation

template<class _Ty , class _Dx >
constexpr unique_ptr< _Ty[], _Dx >::unique_ptr ( )
inline
1877  : _Mybase(pointer())
1878  { // default construct
1879  static_assert(!is_pointer<_Dx>::value,
1880  "unique_ptr constructed with null deleter pointer");
1881  }
_Mybase::pointer pointer
Definition: memory:1870
Definition: type_traits:366
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
template<class _Ty , class _Dx >
template<class _Uty , class = _Enable_ctor_reset<_Uty>>
unique_ptr< _Ty[], _Dx >::unique_ptr ( _Uty  _Ptr)
inlineexplicit
1898  : _Mybase(_Ptr)
1899  { // construct with pointer
1900  static_assert(!is_pointer<_Dx>::value,
1901  "unique_ptr constructed with null deleter pointer");
1902  }
Definition: type_traits:366
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
template<class _Ty , class _Dx >
template<class _Uty , class = _Enable_ctor_reset<_Uty>>
unique_ptr< _Ty[], _Dx >::unique_ptr ( _Uty  _Ptr,
typename _If< is_reference< _Dx >::value, _Dx, const typename remove_reference< _Dx >::type & >::type  _Dt 
)
inline
1909  : _Mybase(_Ptr, _Dt)
1910  { // construct with pointer and (maybe const) deleter&
1911  }
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
template<class _Ty , class _Dx >
template<class _Uty , class = _Enable_ctor_reset<_Uty>>
unique_ptr< _Ty[], _Dx >::unique_ptr ( _Uty  _Ptr,
typename remove_reference< _Dx >::type &&  _Dt 
)
inline
1917  : _Mybase(_Ptr, _STD move(_Dt))
1918  { // construct by moving deleter
1919  static_assert(!is_reference<_Dx>::value,
1920  "unique_ptr constructed with reference to rvalue deleter");
1921  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
Definition: type_traits:315
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( unique_ptr< _Ty[], _Dx > &&  _Right)
inline
1924  : _Mybase(_Right.release(),
1925  _STD forward<_Dx>(_Right.get_deleter()))
1926  { // construct by moving _Right
1927  }
pointer release() _NOEXCEPT
Definition: memory:1842
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
template<class _Ty , class _Dx >
template<class _Uty , class _Ex , class = _Enable_conversion<_Uty, _Ex, is_reference<_Dx>::value ? is_same<_Ex, _Dx>::value : is_convertible<_Ex, _Dx>::value>>
unique_ptr< _Ty[], _Dx >::unique_ptr ( unique_ptr< _Uty, _Ex > &&  _Right)
inline
1958  : _Mybase(_Right.release(),
1959  _STD forward<_Ex>(_Right.get_deleter()))
1960  { // construct by moving _Right
1961  }
pointer release() _NOEXCEPT
Definition: memory:1842
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
template<class _Ty , class _Dx >
constexpr unique_ptr< _Ty[], _Dx >::unique_ptr ( nullptr_t  )
inline
1975  : _Mybase(pointer())
1976  { // null pointer construct
1977  static_assert(!is_pointer<_Dx>::value,
1978  "unique_ptr constructed with null deleter pointer");
1979  }
_Mybase::pointer pointer
Definition: memory:1870
Definition: type_traits:366
_Unique_ptr_base< _Ty, _Dx > _Mybase
Definition: memory:1869
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::~unique_ptr ( )
inline
1999  { // destroy the object
2000  _Delete();
2001  }
void _Delete()
Definition: memory:2040
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( const _Myt )
delete

Member Function Documentation

template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::_Delete ( )
inlineprivate
2041  { // delete the pointer
2042  if (get() != pointer())
2043  this->get_deleter()(get());
2044  }
_Mybase::pointer pointer
Definition: memory:1870
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
template<class _Ty , class _Dx >
pointer unique_ptr< _Ty[], _Dx >::get ( ) const
inline
2009  { // return pointer to object
2010  return (this->_Myptr());
2011  }
pointer & _Myptr() _NOEXCEPT
Definition: memory:1683
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::operator bool ( ) const
inlineexplicit
2014  { // test for non-null pointer
2015  return (get() != pointer());
2016  }
_Mybase::pointer pointer
Definition: memory:1870
template<class _Ty , class _Dx >
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( _Myt &&  _Right)
inline
1930  { // assign by moving _Right
1931  if (this != _STD addressof(_Right))
1932  { // different, do the swap
1933  reset(_Right.release());
1934  this->get_deleter() = _STD move(_Right.get_deleter());
1935  }
1936  return (*this);
1937  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
void reset(nullptr_t=nullptr_t{}) _NOEXCEPT
Definition: memory:1987
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Ty , class _Dx >
template<class _Uty , class _Ex , class = _Enable_conversion<_Uty, _Ex, is_assignable<_Dx&, _Ex&&>::value>>
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( unique_ptr< _Uty, _Ex > &&  _Right)
inline
1968  { // assign by moving _Right
1969  reset(_Right.release());
1970  this->get_deleter() = _STD forward<_Ex>(_Right.get_deleter());
1971  return (*this);
1972  }
pointer release() _NOEXCEPT
Definition: memory:1842
void reset(nullptr_t=nullptr_t{}) _NOEXCEPT
Definition: memory:1987
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
template<class _Ty , class _Dx >
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( nullptr_t  )
inline
1982  { // assign a null pointer
1983  reset();
1984  return (*this);
1985  }
void reset(nullptr_t=nullptr_t{}) _NOEXCEPT
Definition: memory:1987
template<class _Ty , class _Dx >
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( const _Myt )
delete
template<class _Ty , class _Dx >
_Ty& unique_ptr< _Ty[], _Dx >::operator[] ( size_t  _Idx) const
inline
2004  { // return reference to object
2005  return (get()[_Idx]);
2006  }
template<class _Ty , class _Dx >
pointer unique_ptr< _Ty[], _Dx >::release ( )
inline
2019  { // yield ownership of pointer
2020  pointer _Ans = get();
2021  this->_Myptr() = pointer();
2022  return (_Ans);
2023  }
pointer & _Myptr() _NOEXCEPT
Definition: memory:1683
_Mybase::pointer pointer
Definition: memory:1870
template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::reset ( nullptr_t  = nullptr_t{})
inline
1987  {}) _NOEXCEPT
1988  { // establish new null pointer
1989  reset(pointer());
1990  }
#define _NOEXCEPT
Definition: yvals.h:84
void reset(nullptr_t=nullptr_t{}) _NOEXCEPT
Definition: memory:1987
_Mybase::pointer pointer
Definition: memory:1870
template<class _Ty , class _Dx >
template<class _Uty , class = _Enable_ctor_reset<_Uty, false_type>>
void unique_ptr< _Ty[], _Dx >::reset ( _Uty  _Ptr)
inline
2028  { // establish new pointer
2029  pointer _Old = get();
2030  this->_Myptr() = _Ptr;
2031  if (_Old != pointer())
2032  this->get_deleter()(_Old);
2033  }
pointer & _Myptr() _NOEXCEPT
Definition: memory:1683
_Mybase::pointer pointer
Definition: memory:1870
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::swap ( _Myt _Right)
inline
1993  { // swap elements
1994  _Swap_adl(this->_Myptr(), _Right._Myptr());
1995  _Swap_adl(this->get_deleter(), _Right.get_deleter());
1996  }
pointer & _Myptr() _NOEXCEPT
Definition: memory:1683
_Dx & get_deleter() _NOEXCEPT
Definition: memory:1673
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:73
constexpr const _Ty &() _Right
Definition: algorithm:3723

The documentation for this class was generated from the following file: